package pers.xhh.frontapi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.xhh.frontapi.common.Mi;
import pers.xhh.frontapi.service.MiCategoryService;

/**
 * @author wei-xhh
 * @date 2020-11-24
 */
@CrossOrigin
@RestController
@RequestMapping("/mi/api")
public class MiCategoryController {

    @Autowired
    MiCategoryService miCategoryService;

    @GetMapping("/categories")
    public Mi updateRights(@RequestParam(required = false) Integer type,
                           @RequestParam(required = false) Integer pagenum,
                           @RequestParam(required = false) Integer pagesize){
        return miCategoryService.listCategory(type, pagenum, pagesize);
    }

    @GetMapping("/cateOneList")
    public Mi getCateOneList() {
        return miCategoryService.getCateOneList();
    }

    @PostMapping("/banner")
    public Mi getBanner() {
        return miCategoryService.getBanner();
    }

}
